<?
require("config.php");

$location_status .= " | Edit";

$show_backnav = "type_menu";

$menuname = NULL;

$menutarget = NULL;

if (NULL!=$action){

   $table = "pro_type";

   $field = array(
	"code", 
	"name", 
	);


   $content = array(
	$Code,
	$Name,
	);

   $expression = "id = $id";

   myUpdate($table,$field,$content,$expression);

   header("location:" . $rela_path . "share/msg.php?v=57");

   exit();

}

if (!checkRecord($table,$id)){

	header("location:" . $rela_path . "share/msg.php?v=9001");
  
}


$Query = "select * from pro_type where id = $id";
$r = myQuery($Query);

if (!$r)header("location:" . $rela_path . "share/msg.php?v=9002");

$Code = $r[0][1];
$Name = $r[0][2];

require($rela_path . "inc/header.php");

?>
<form action="" method="post" name="form1">
<table width="95%" border="0" align="center">
    <tr> 
      <td align="right">&nbsp;</td>
  </tr>
  <tr> 
    <td><table width="75%">
          <tr> 
            <td class="tdheader">Code :</td>
            <td><input type="text" class="text" name="Code" size="40" value=<?print($Code)?>> 
              <input name="action" type="hidden" id="action" value="edit"> <input name="id" type="hidden" value="<?print($id)?>"> 
            </td>
          </tr>
          <tr> 
            <td class="tdheader">Name :</td>
            <td><input type="text" class="text" name="Name" size="40" value="<?print($Name)?>"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><input type="image" src="../../images/bt_cancel.gif" onClick="Redirect('type_menu.php',1);return false;">
              <input type="image" src="../../images/bt_save.gif">
            </td>
          </tr>
        </table>
        <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp; </p></td>
  </tr>
</table>
</form>
<?
require($rela_path . "inc/footer.php");
?>
